<template>
  <div>
    <tableComponents
      :pagination="{ currentPage, pageSize, total: list.all_num }"
      @handleCurrentChange="handleCurrentChange"
      @handleSizeChange="handleSizeChange"
      @sendUserSearch="getSearch"
      :searchData="userSearchData"
      :isHaveExport="false"
      :isHaveAdd="false"
    >
      <template v-slot:table>
        <el-table
          ref="multipleTable"
          :data="list.data"
          stripe
          v-loading="loading"
          header-row-class-name="head_color"
          tooltip-effect="dark"
          style="width: 99.8%"
        >
          <el-table-column
            label="头像"
            width="120"
            align="center"
            min-width="80"
          >
            <template slot-scope="scope">
              <div class="img_bor">
                <img :src="$fnc.getImgUrl(scope.row.avatar)" alt />
              </div>
            </template>
          </el-table-column>

          <el-table-column label="用户信息" min-width="120">
            <template slot-scope="scope">
              <p>用户名：{{ scope.row.username }}</p>
              <p>昵称：{{ scope.row.nickname }}</p>
            </template>
          </el-table-column>

          <el-table-column label="ip地址" min-width="120">
            <template slot-scope="scope">{{ scope.row.ip }}</template>
          </el-table-column>

          <el-table-column label="身份证号" min-width="140">
            <template slot-scope="scope">{{ scope.row.card }}</template>
          </el-table-column>

          <el-table-column label="认证姓名" min-width="100">
            <template slot-scope="scope">{{ scope.row.name }}</template>
          </el-table-column>

          <el-table-column label="时间" min-width="140">
            <template slot-scope="scope">
              {{ scope.row.created_time | getTimeFormat }}
            </template>
          </el-table-column>
        </el-table>
      </template>
    </tableComponents>
  </div>
</template>
<script>
import { faceListSearchData } from "@/assets/js/searchData/searchData"; //引入搜索的数据
export default {
  data() {
    return {
      userSearchData: faceListSearchData,
      loading: false,
      list: [],
      pageSize: 10,
      currentPage: 1,
      arr: [],
      searchAll: {},
    };
  },
  components: {},
  methods: {
    getSearch(obj) {
      this.searchAll = obj;
      this.getNewsAll(obj);
    },
    getNewsAll(data) {
      this.loading = true;
      var params = {};
      data = data || {};
      params = data;

      this.$api.getUser.get_face_lists(params).then((res) => {
        if (res.data.code == 200) {
          this.list = res.data.result;
        }
        this.loading = false;
      });
    },
    handleSizeChange(val) {
      var params = this.searchAll;
      params.page = "";
      params.page_size = val;
      this.getNewsAll(params);
      this.pageSize = val;
    },
    handleCurrentChange(val) {
      this.currentPage = val;
      var params = this.searchAll;
      params.page = val;
      params.page_size = this.pageSize;
      this.getNewsAll(params);
    },
  },
  beforeCreate() {},
  created() {
    this.getNewsAll();
  },
  computed: {},
};
</script>

<style lang="less" scoped>
</style>
